package easy

func CountTestedDevices(batteryPercentages []int) int {
	cnt := 0
	for i := 0; i < len(batteryPercentages); i++ {
		if batteryPercentages[i] > 0 {
			cnt++
			for j := i + 1; j < len(batteryPercentages); j++ {
				if batteryPercentages[j] > 0 {
					batteryPercentages[j]--
				}
			}
		}
	}
	return cnt
}
